//package com.wlz.eventListener;
//
//import org.springframework.context.ApplicationEvent;
//import org.springframework.context.ApplicationListener;
//import org.springframework.context.event.AbstractApplicationEventMulticaster;
//import org.springframework.core.ResolvableType;
//import org.springframework.core.task.SimpleAsyncTaskExecutor;
//import org.springframework.core.task.TaskExecutor;
//
//import java.util.Iterator;
//
///**
// * @author wlz
// * @date 2022-05-26  10:57 下午
// */
//public class AsyncApplicationEventMulticaster extends AbstractApplicationEventMulticaster {
//
//	private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
//
//	public void setTaskExecutor(TaskExecutor taskExecutor) {
//		this.taskExecutor = (taskExecutor != null ? taskExecutor : new SimpleAsyncTaskExecutor());
//	}
//
//	public TaskExecutor getTaskExecutor() {
//		return this.taskExecutor;
//	}
//
//	@SuppressWarnings("unchecked")
//	@Override
//	public void multicastEvent(ApplicationEvent event) {
//		for (Iterator<ApplicationListener<?>> it = getApplicationListeners().iterator(); it.hasNext();) {
//				final ApplicationListener listener = it.next();
//				getTaskExecutor().execute(new Runnable() {
//					@Override
//					public void run() {
//						listener.onApplicationEvent(event);
//					}
//				});
//		}
//	}
//
//	@Override
//	public void multicastEvent(ApplicationEvent event, ResolvableType eventType) {
//
//	}
//}
